#include "test.h"

int main()
{
    int fd = open(FNAME,O_RDONLY);
    if(fd == -1)
    {
        printf("%s%d:%s\n","open read error! ",errno,strerror(errno));
        exit(EOF);
    }

    while(true)
    {
        char str[_size] = {0};
        int n = read(fd,str,sizeof(str));
        if(n > 0)
        {
            str[strlen(str)] = 0;
            printf("%s\n",str);
        }
        else
        {
            break;
        }
    }

    close(fd);

    return 0;
}